<template>
  <div class="welcome-container">
    <!-- 视频背景 -->
    <div class="video-background">
      <video autoplay muted loop playsinline>
        <source src="@/assets/welcome-video.mp4" type="video/mp4">
      </video>
    </div>

    <!-- 内容区域 -->
    <div class="content-wrapper">
      <!-- Logo区域 -->
      <div class="logo-section">
        <img src="@/assets/logo.png" alt="MicroInvest Logo" class="main-logo">
      </div>

      <!-- 主标题区域 -->
      <div class="text-content">
        <h1 class="main-title">MicroInvest</h1>
        <p class="subtitle">引领金融科技的未来</p>
        <p class="description">专业的投资平台，为您的财富增值保驾护航</p>
      </div>

      <!-- 特色服务区域 -->
      <div class="features-section">
        <div class="feature-item">
          <h3>专业投资服务</h3>
          <p>最低的交易成本，最快捷的交易体验，强大的API支持</p>
        </div>
        <div class="feature-item">
          <h3>全程投资护航</h3>
          <p>从投资新手到资深投资者，我们提供全方位的专业指导</p>
        </div>
        <div class="feature-item">
          <h3>全球市场覆盖</h3>
          <p>连接全球金融市场，把握每一个投资机会</p>
        </div>
      </div>

      <!-- 品牌价值区域 -->
      <div class="brand-section">
        <h2>走近 MicroInvest</h2>
        <p>在我们世界级合作伙伴的支持下，了解为什么 MicroInvest 是您最值得信赖的投资平台</p>
      </div>

      <!-- 服务介绍区域 -->
      <div class="services-section">
        <div class="service-item">
          <h3>股票交易</h3>
          <p>全球股票市场实时交易，专业分析工具支持</p>
        </div>
        <div class="service-item">
          <h3>基金投资</h3>
          <p>多样化基金产品，专业基金经理管理</p>
        </div>
        <div class="service-item">
          <h3>数据分析</h3>
          <p>深度市场分析，智能投资建议</p>
        </div>
      </div>

      <!-- 常见问题区域 -->
      <div class="faq-section">
        <h2>常见问题</h2>
        <div class="faq-list">
          <div class="faq-item">
            <h4>MicroInvest 提供哪些投资产品？</h4>
            <p>我们提供股票、基金、债券等多种投资产品，满足不同投资需求</p>
          </div>
          <div class="faq-item">
            <h4>如何开始投资？</h4>
            <p>注册账户，完成身份认证，即可开始您的投资之旅</p>
          </div>
          <div class="faq-item">
            <h4>投资安全如何保障？</h4>
            <p>采用银行级安全系统，资金由第三方托管，确保投资安全</p>
          </div>
        </div>
      </div>

      <!-- 开始按钮 -->
      <div class="action-buttons">
        <el-button type="primary" size="large" @click="startJourney" class="start-button">
          开始投资之旅
        </el-button>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter} from 'vue-router';
import {useTokenStore} from "@/stores/token";
const router = useRouter();

const startJourney = () => {
  if(useTokenStore().hasToken){
    router.push('/center/findStock')
  }
  else router.push('/user/auth')
}
</script>

<style scoped>
.welcome-container {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #000;
  overflow: hidden; /* 改为 hidden，防止出现滚动条 */
}

.video-background {
  position: absolute; /* 改为 absolute，相对于容器定位 */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.video-background video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

.content-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 2rem;
  text-align: center;
  background: linear-gradient(to bottom, rgba(0,0,0,0.12), rgba(0,0,0,0.95));
  height: 100%;
  overflow-y: auto; /* 内容区域可滚动 */
}

.logo-section {
  margin-bottom: 2rem;
  animation: fadeInDown 1s ease-out;
}

.main-logo {
  width: 180px;
  height: 180px;
  object-fit: contain;
}

.text-content {
  margin-bottom: 3rem;
  animation: fadeInUp 1s ease-out 0.5s both;
}

.main-title {
  font-size: 4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.subtitle {
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 1rem;
  font-weight: 300;
  letter-spacing: 1px;
}

.description {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.12);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.features-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin: 4rem 0;
  width: 100%;
  max-width: 1200px;
  animation: fadeInUp 1s ease-out 0.7s both;
}

.feature-item {
  background: rgba(255,255,255,0.05);
  padding: 2rem;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-5px);
}

.feature-item h3 {
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.feature-item p {
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  line-height: 1.6;
}

.brand-section {
  margin: 4rem 0;
  animation: fadeInUp 1s ease-out 0.9s both;
}

.brand-section h2 {
  color: #fff;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.brand-section p {
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  max-width: 800px;
  margin: 0 auto;
}

.services-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin: 4rem 0;
  width: 100%;
  max-width: 1200px;
  animation: fadeInUp 1s ease-out 1.1s both;
}

.service-item {
  background: rgba(255,255,255,0.05);
  padding: 2rem;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
}

.service-item h3 {
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.service-item p {
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  line-height: 1.6;
}

.faq-section {
  margin: 4rem 0;
  width: 100%;
  max-width: 800px;
  animation: fadeInUp 1s ease-out 1.3s both;
}

.faq-section h2 {
  color: #fff;
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.faq-item {
  background: rgba(255,255,255,0.05);
  padding: 1.5rem;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  text-align: left;
}

.faq-item h4 {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.faq-item p {
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  line-height: 1.6;
}

.action-buttons {
  margin-top: 4rem;
  animation: fadeInUp 1s ease-out 1.5s both;
}

.start-button {
  padding: 1rem 3rem;
  font-size: 1.2rem;
  border-radius: 50px;
  background: linear-gradient(45deg, #1a1a1a, #333);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  transition: all 0.3s ease;
}

.start-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  background: linear-gradient(45deg, #333, #1a1a1a);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .features-section,
  .services-section {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .main-title {
    font-size: 3rem;
  }
  
  .subtitle {
    font-size: 1.5rem;
  }
  
  .description {
    font-size: 1rem;
  }
  
  .main-logo {
    width: 150px;
    height: 150px;
  }

  .features-section,
  .services-section {
    grid-template-columns: 1fr;
  }

  .brand-section h2,
  .faq-section h2 {
    font-size: 2rem;
  }
}

</style> 